<local:DocumentBase x:Class="WPFExcelReport.YCACOFS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core" 
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    FontSize="12"
                   Background="White"
                    Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <ucd:PreisConverter  x:Key="PreisConverter"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <db:SETINTEXDB  x:Key="SetEnv" />
        <CollectionViewSource   x:Key="vwABCO" Source="{Binding Path=ICC_ABPOS_MCO,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwPABCO" Source="{Binding Path=ICC_ABPOS_MCO,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFSSTAMM" Source="{Binding Path=FSSTAMM,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwABPOS_MAT" Source="{Binding Path=ICC_ABPOS_MAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwMDECKMAT" Source="{Binding Path=ICC_MDECKMAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwWDECKMAT" Source="{Binding Path=ICC_WDECKMAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFDECKMAT" Source="{Binding Path=ICC_FDECKMAT,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwXDECK" Source="{Binding Path=ICC_ABAUFM,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwSECTION" Source="{Binding Path=ICC_SECTION,Source={StaticResource SetEnv}}" />
    </local:DocumentBase.Resources>
    <TabControl>
        <TabItem Header="{Binding Source={Localization:Translate Word=成本}}" Background="White">
            <Grid   >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0"  Grid.ColumnSpan="6" Margin="0,0,0,0">
                    <WrapPanel> 
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"  FontSize="18"  Width="59"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=款式}}" />
                            <TextBox Grid.Column="1"  Background="Yellow"  FontSize="18"    Width="140" Name="txtFSART" CharacterCasing="Upper" Margin="10,0,0,0" Text="" />
                        </Grid> 
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0"  Width="30" Height="30"  Click="btnLoad_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="Image/Find.png" />
                                </Button.Background>
                            </Button>
                            <Button Grid.Column="1" Content="{Binding Source={Localization:Translate Word=查询}}"  FontSize="18" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnLoad_Click"/>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=年份}}"></TextBlock>
                            <TextBox Grid.Column="1" FontSize="18" Name="txtYear" VerticalAlignment="Center">2014</TextBox>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0" FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=波段}}"></TextBlock>
                            <ComboBox Grid.Column="1" Width="100" Name="cbSECTION"
                                                      DisplayMemberPath="SDDATEN"
                                                      SelectedValuePath="SDKEY"
                                                      SelectionChanged="cbSECTION_SelectionChanged"
                                                      ItemsSource="{Binding Source={StaticResource ResourceKey=vwSECTION}}"  
                                                      ></ComboBox>
                            <TextBox Grid.Column="2" Name="txtSection" Width="220" FontSize="18" Background="Beige" CharacterCasing="Upper" ></TextBox>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" Width="Auto" Content="{Binding Source={Localization:Translate Word=过滤}}" Margin="10,0,0,0"  HorizontalAlignment="Left" Name="btnFilterABCO" Click="btnFilterABCO_Click"></Button>
                            <Button Grid.Column="1" Width="Auto" Content="{Binding Source={Localization:Translate Word=清除}}" Margin="10,0,0,0" HorizontalAlignment="Left" Name="btnFilterABCOClear" Click="btnFilterABCOClear_Click" ></Button>

                        </Grid> 
                       </WrapPanel>
                </StackPanel>
                <DataGrid Grid.Row="1"
                AutoGenerateColumns="False"
                EnableRowVirtualization="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                          VerticalAlignment="Top"
                HeadersVisibility="Column" 
                FontSize="12"
                IsReadOnly="True"
                HorizontalAlignment="Stretch" 
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwABCO}}"  
                x:Name="dlgABCO" 
                Margin="0,1,0,0"             
                RowDetailsVisibilityMode="Visible"
                    >
                    <DataGrid.RowDetailsTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="50,0,0,0" HorizontalAlignment="Left">
                                <TextBlock Foreground="Black" FontSize="12" Text="{Binding Source={Localization:Translate Word=计划量}}"/>
                                <TextBlock Foreground="Black" FontSize="12" Text="{Binding Path=QTYP}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Source={Localization:Translate Word=S:}}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Path=SP}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Source={Localization:Translate Word=M:}}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=MP}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Source={Localization:Translate Word=L:}}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=LP}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Source={Localization:Translate Word=XL:}}"/>
                                <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=XLP}"/>
                            </StackPanel>
                        </DataTemplate>
                    </DataGrid.RowDetailsTemplate>
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=ABPSPGRD}" Header="{Binding Source={Localization:Translate Word=确认}}"   Width="30" />
                        <DataGridTextColumn Binding="{Binding Path=ABPGESSTA}" Header="{Binding Source={Localization:Translate Word=状态}}"   Width="30" />
                        <DataGridTextColumn Binding="{Binding Path=END}" Header="{Binding Source={Localization:Translate Word=结}}"   Width="20" />
                        <DataGridTextColumn Binding="{Binding Path=KRS}" Header=""   Width="30" />
                        <DataGridTextColumn Binding="{Binding Path=LFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=生产单}}"   Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=ART,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=款式}}"   Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=FARBE,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="Auto" />
                        <DataGridTextColumn Binding="{Binding Path=QTY}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=QTYP}" Header="{Binding Source={Localization:Translate Word=计划数}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=S}" Header="{Binding Source={Localization:Translate Word=S}}"   Width="Auto">
                        </DataGridTextColumn>
                        <DataGridTextColumn Binding="{Binding Path=M}" Header="{Binding Source={Localization:Translate Word=M}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=L}" Header="{Binding Source={Localization:Translate Word=L}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=XL}" Header="{Binding Source={Localization:Translate Word=XL}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQSTDPSTD}" Header="{Binding Source={Localization:Translate Word=标准基准}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQSTDPEK}" Header="{Binding Source={Localization:Translate Word=标准采购}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQSTDPPLAN}" Header="{Binding Source={Localization:Translate Word=标准预期}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQPLANPSTD}" Header="{Binding Source={Localization:Translate Word=计划基准}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQPLANPEK}" Header="{Binding Source={Localization:Translate Word=计划采购}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQPLANPPLAN}" Header="{Binding Source={Localization:Translate Word=计划实际}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQACTPSTD}" Header="{Binding Source={Localization:Translate Word=实际基准}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQACTPEK}" Header="{Binding Source={Localization:Translate Word=实际采购}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=VMQACTPPLAN}" Header="{Binding Source={Localization:Translate Word=实际预期}}"   Width="Auto"/>
                        <DataGridTextColumn Binding="{Binding Path=PRODV}" Header="{Binding Source={Localization:Translate Word=加工费}}"   Width="Auto"/>
                    </DataGrid.Columns>
                </DataGrid  >
            </Grid>
        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=明细}}" Background="White">
            <Grid   >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="100" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="300" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="1*" />
                    <ColumnDefinition Width="1*" />
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
                    <WrapPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" Name="btnRefresh" Width="30" Height="30"  Click="btnRefresh_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="Image/Refresh.png" />
                                </Button.Background>
                            </Button>
                            <Button Grid.Column="1" Content="{Binding Source={Localization:Translate Word=初始化}}"  FontSize="18" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnRefresh_Click"/>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0"  Width="30" Height="30"  Click="btnReset_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="Image/Reload.png" />
                                </Button.Background>
                            </Button>
                            <Button Grid.Column="1" Content="{Binding Source={Localization:Translate Word=重置成本}}"  FontSize="18" Height="30" Width="Auto" VerticalAlignment="Center" Click="btnReset_Click"/>
                        </Grid>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                                <ColumnDefinition Width="Auto"></ColumnDefinition>
                            </Grid.ColumnDefinitions>
                            <Button Grid.Column="0" FontSize="18" Height="30" Width="30" Margin="5,0,0,0" Name="btnPrint" Click="btnPrint_Click">
                                <Button.Background>
                                    <ImageBrush  ImageSource="Image/Print.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Grid.Column="1" Margin="5,0,0,0"  FontSize="18" VerticalAlignment="Center"  Text="{Binding Source={Localization:Translate Word=打印}}"></TextBlock>

                        </Grid>               
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock FontSize="18"   Width="59"  Margin="0,0,0,0" Text="{Binding Source={Localization:Translate Word=款式}}" />
                    </WrapPanel>
                </StackPanel>
                <DockPanel  Grid.Row="1" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="1" VerticalAlignment="Top" >
                    <DataGrid DockPanel.Dock="Top"
                AutoGenerateColumns="False"
                EnableRowVirtualization="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                HeadersVisibility="Column" 
                FontSize="12"
                IsReadOnly="True"
                HorizontalAlignment="Stretch"                    
                VerticalAlignment="Stretch"
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwPABCO}}"  
                x:Name="dlgPABCO" 
                Margin="0,1,0,0"             
                RowDetailsVisibilityMode="Visible"
                    >
                        <DataGrid.RowDetailsTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="50,0,0,0" HorizontalAlignment="Left">
                                    <TextBlock Foreground="Black" FontSize="12" Text="{Binding Source={Localization:Translate Word=计划量}}"/>
                                    <TextBlock Foreground="Black" FontSize="12" Text="{Binding Path=QTYP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Source={Localization:Translate Word=S:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Path=SP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0" FontSize="12" Text="{Binding Source={Localization:Translate Word=M:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=MP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Source={Localization:Translate Word=L:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=LP}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Source={Localization:Translate Word=XL:}}"/>
                                    <TextBlock Foreground="Black" Margin="10,0,0,0"  FontSize="12" Text="{Binding Path=XLP}"/>
                                </StackPanel>
                            </DataTemplate>
                        </DataGrid.RowDetailsTemplate>
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=ABPSPGRD}" Header="{Binding Source={Localization:Translate Word=确认}}"   Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=ABPGESSTA}" Header="{Binding Source={Localization:Translate Word=状态}}"   Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=MPRICE}" Header="{Binding Source={Localization:Translate Word=单价}}"   Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=END}" Header="{Binding Source={Localization:Translate Word=结}}"   Width="20" />
                            <DataGridTextColumn Binding="{Binding Path=KRS}" Header=""   Width="30" />
                            <DataGridTextColumn Binding="{Binding Path=LFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=生产单}}"   Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=ART,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=款式}}"   Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=FARBE,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="Auto" />
                            <DataGridTextColumn Binding="{Binding Path=QTY}" Header="{Binding Source={Localization:Translate Word=数量}}"   Width="Auto"/>
                            <DataGridTextColumn Binding="{Binding Path=QTYP}" Header="{Binding Source={Localization:Translate Word=计划数}}"   Width="Auto"/>
                            <DataGridTextColumn Binding="{Binding Path=S}" Header="{Binding Source={Localization:Translate Word=S}}"   Width="Auto">
                            </DataGridTextColumn>
                            <DataGridTextColumn Binding="{Binding Path=M}" Header="{Binding Source={Localization:Translate Word=M}}"   Width="Auto"/>
                            <DataGridTextColumn Binding="{Binding Path=L}" Header="{Binding Source={Localization:Translate Word=L}}"   Width="Auto"/>
                            <DataGridTextColumn Binding="{Binding Path=XL}" Header="{Binding Source={Localization:Translate Word=XL}}"   Width="Auto"/>
                            <DataGridTextColumn Binding="{Binding Path=VMQACTPEK}" Header="{Binding Source={Localization:Translate Word=实际采购}}"   Width="Auto"/>
                            <DataGridTextColumn Binding="{Binding Path=PRODV}" Header="{Binding Source={Localization:Translate Word=加工费}}"   Width="Auto"/>
                        </DataGrid.Columns>
                    </DataGrid  >
                    <Expander Header="{Binding Source={Localization:Translate Word=订单执行情况}}"  IsExpanded="True" ExpandDirection="Down">
                        <DataGrid 
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"                  
                                AutoGenerateColumns="False"   
                                EnableRowVirtualization="False"  
                                HorizontalAlignment="Stretch" 
                                HorizontalScrollBarVisibility="Auto"
                                VerticalScrollBarVisibility="Auto"
                                IsSynchronizedWithCurrentItem="True"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS}}"  
                                x:Name="dlgEKPOS" 
                                Margin="0,1,0,0" 
                                Height="200"
                                RowDetailsVisibilityMode="Visible"
                                >
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABPGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=Z}}"   Width="20" />
                                <DataGridTextColumn Binding="{Binding Path=ABPERLKZ}" Header="{Binding Source={Localization:Translate Word=结}}"   Width="30" />
                                <DataGridTextColumn Binding="{Binding Path=ABPERLDAT}" Header="{Binding Source={Localization:Translate Word=日期}}"   Width="80" />
                                <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE5, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=意向}}"   Width="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=计划}}"   Width="60" />
                                <DataGridTextColumn Binding="{Binding Path=ABPEALFM, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=产量}}"   Width="60" />
                            </DataGrid.Columns>
                        </DataGrid  >
                    </Expander>
                </DockPanel>
                <DockPanel  Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="1" Grid.RowSpan="3">
                    <StackPanel>
                        <Expander Header="{Binding Source={Localization:Translate Word=面料消耗}}" IsExpanded="False" ExpandDirection="Down">
                            <DataGrid 
                    CanUserReorderColumns="True"  
                    CanUserResizeRows="True" CanUserSortColumns="True"                  
                    AutoGenerateColumns="False"   
                    EnableRowVirtualization="True"  
                    RowDetailsVisibilityMode="Visible"
                    HorizontalAlignment="Stretch" 
                    VerticalAlignment="Stretch"
                    IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwWDECKMAT}}" 
                    x:Name="dlgWDECK" 
                    Grid.ColumnSpan="4" Margin="0,1,0,0" Grid.Row="2"                   >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=ART,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=面料}}"   Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=FARBE,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=QTYSTD}" Header="{Binding Source={Localization:Translate Word=标准}}"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=QTYPLAN}" Header="{Binding Source={Localization:Translate Word=计划}}"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=QTYACT}" Header="{Binding Source={Localization:Translate Word=实际}}"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=UM}" Header="{Binding Source={Localization:Translate Word=UM}}"   Width="60" />
                                </DataGrid.Columns>
                            </DataGrid  >
                        </Expander>
                        <Expander Header="{Binding Source={Localization:Translate Word=辅料消耗}}" IsExpanded="False" ExpandDirection="Down">
                            <DataGrid 
                    CanUserReorderColumns="True"  
                    CanUserResizeRows="True" CanUserSortColumns="True"                  
                    AutoGenerateColumns="False"     
                    EnableRowVirtualization="True"  
                    RowDetailsVisibilityMode="VisibleWhenSelected" 
                    HorizontalAlignment="Stretch" 
                    VerticalAlignment="Stretch"
                    IsSynchronizedWithCurrentItem="True" 
                    Opacity="10" Visibility="Visible"
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwFDECKMAT}}"  
                    x:Name="dlgFDECK" 
                    >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding Path=ART,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=辅料}}"   Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=FARBE,Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=颜色}}"   Width="Auto" />
                                    <DataGridTextColumn Binding="{Binding Path=SIZE}" Header="{Binding Source={Localization:Translate Word=尺寸}}"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=QTYSTD}" Header="{Binding Source={Localization:Translate Word=标准}}"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=QTYPLAN}" Header="{Binding Source={Localization:Translate Word=计划}}"   Width="60" />
                                    <DataGridTextColumn Binding="{Binding Path=QTYACT}" Header="{Binding Source={Localization:Translate Word=实际}}"   Width="60" />
                                </DataGrid.Columns>
                            </DataGrid  >
                        </Expander>
                    </StackPanel>
                </DockPanel>
                <DockPanel  Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="1" Grid.RowSpan="3" >
                    <StackPanel>
                        <Expander FontSize="12" Header="{Binding Source={Localization:Translate Word=面料信息}}" Name="zoneFabric" IsExpanded="False" ExpandDirection="Down">
                        </Expander>
                        <Expander FontSize="12" Header="{Binding Source={Localization:Translate Word=审核区域}}" Name="zoneMaterial" IsExpanded="False" ExpandDirection="Down">
                            <StackPanel>
                                <WrapPanel>
                                    <StackPanel>
                                        <Button Height="20" Width="20" Margin="2,0,0,0" Name="btnPushQty" Click="btnPushQty_Click">
                                            <Button.Background>
                                                <ImageBrush  ImageSource="Image/Refresh.png" />
                                            </Button.Background>
                                        </Button>
                                    </StackPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=分配实际用量}}" VerticalAlignment="Center"></TextBlock>
                                    <TextBox Background="White"  FontSize="18"    Width="60" Name="txtNQTy" Height="25" Margin="10,0,0,0"  />
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=物料:}}"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow" Text="{Binding Path=ART, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=描述:}}"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"  Text="{Binding Path=ARTDES, Source={StaticResource ResourceKey=vwXDECK},Converter={StaticResource ResourceKey=gb2312}}" Width="120"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=色号:}}"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=COLOR, Source={StaticResource ResourceKey=vwXDECK}}" Width="60"></TextBlock>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=尺码:}}"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=ASIZE, Source={StaticResource ResourceKey=vwXDECK},Converter={StaticResource ResourceKey=gb2312}}" Width="60"></TextBlock>
                                    <TextBlock>UM:</TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=UM, Source={StaticResource ResourceKey=vwXDECK}}" Width="40"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=用量:}}"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=QTYSTD, Source={StaticResource ResourceKey=vwXDECK}}" Width="50"></TextBlock>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=计划:}}"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=QTYPLAN, Source={StaticResource ResourceKey=vwXDECK}}" Width="50"></TextBlock>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=实际:}}"></TextBlock>
                                    <TextBox Text="{Binding Path=QTYACT, Source={StaticResource ResourceKey=vwXDECK}}" Width="50"></TextBox>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=单价:}}"></TextBlock>
                                    <TextBox Text="{Binding Path=PRSTD, Source={StaticResource ResourceKey=vwXDECK}}" Width="50"></TextBox>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=采购:}}"></TextBlock>
                                    <TextBox Text="{Binding Path=PREK, Source={StaticResource ResourceKey=vwXDECK}}" Width="50"></TextBox>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=预期:}}"></TextBlock>
                                    <TextBox Text="{Binding Path=PRPLAN, Source={StaticResource ResourceKey=vwXDECK}}" Width="50"></TextBox>
                                </WrapPanel>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=标准成本:}}"></TextBlock>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=标准用量*标准价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=VQTYSTDPRSTD, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=标准用量*采购价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=VQTYSTDPREK, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=标准用量*预期价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"   Text="{Binding Path=VQTYSTDPRPLAN, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=计划成本:}}"></TextBlock>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=计划用量*标准价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"  Text="{Binding Path=VQTYPLANPRSTD, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=计划用量*标准价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"  Text="{Binding Path=VQTYPLANPREK, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=计划用量*标准价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"  Text="{Binding Path=VQTYPLANPRPLAN, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=实际成本:}}"></TextBlock>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=实际用量*标准价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"  Text="{Binding Path=VQTYACTPRSTD, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=实际用量*标准价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"  Text="{Binding Path=VQTYACTPREK, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                                <WrapPanel>
                                    <TextBlock Text="{Binding Source={Localization:Translate Word=实际用量*标准价格}}" Margin="10,0,0,0"></TextBlock>
                                    <TextBlock Background="LightGoldenrodYellow"  Text="{Binding Path=VQTYACTPRPLAN, Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwXDECK}}" Width="80"></TextBlock>
                                </WrapPanel>
                            </StackPanel>
                        </Expander>
                    </StackPanel>
                </DockPanel>
                <DockPanel  Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" Grid.RowSpan="1" >
                    <StackPanel>
                        <WrapPanel >
                            <TextBlock Text="{Binding Source={Localization:Translate Word=物料类型:}}" FontSize="18"></TextBlock>
                            <TextBox  FontSize="18" Name="txtMTYPE" Width="20">F</TextBox>
                            <TextBlock  Text="{Binding Source={Localization:Translate Word=物料:}}" FontSize="18"></TextBlock>
                            <TextBox Name="txtMART" Background="Yellow" Width="120" FontSize="18">B</TextBox>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=色号:}}" FontSize="18"></TextBlock>
                            <TextBox Name="txtMCOLOR" Background="White" Width="60" FontSize="18"   ></TextBox>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=尺码:}}"  FontSize="18"></TextBlock>
                            <TextBox Name="txtMSIZE" Background="White" Width="60" FontSize="18"  ></TextBox>
                            <Button Width="Auto" Content="{Binding Source={Localization:Translate Word=过滤}}" FontSize="18"  Margin="10,0,0,0"  HorizontalAlignment="Left" Name="btnFilterMat" Click="btnFilterMat_Click"></Button>
                            <Button Width="Auto" Content="{Binding Source={Localization:Translate Word=清除}}"  FontSize="18"  Margin="10,0,0,0" HorizontalAlignment="Left" Name="btnFilterMatClear" Click="btnFilterMatClear_Click"></Button>
                            <Button Name="btnApprove" Click="btnApprove_Click" Margin="30,0,0,0" Height="30" Width="30">
                                <Button.Background>
                                    <ImageBrush  ImageSource="Image/button_ok.png" />
                                </Button.Background>
                            </Button>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=审核通过此物料}}" Margin="10,0,0,0" VerticalAlignment="Center"  FontSize="18" ></TextBlock>
                            <TextBlock Text="{Binding Source={Localization:Translate Word=至少有一个原料需要执行更新实际数量}}" Margin="10,0,0,0" VerticalAlignment="Center"  FontSize="18" ></TextBlock>
                        </WrapPanel>
                        <DataGrid 
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"                  
                                AutoGenerateColumns="False"   
                                EnableRowVirtualization="False"  
                                HorizontalAlignment="Stretch" 
                                HorizontalScrollBarVisibility="Auto"
                                VerticalScrollBarVisibility="Auto"
                                IsSynchronizedWithCurrentItem="True"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwXDECK}}"  
                                x:Name="dlgXDECK" 
                                Margin="0,1,0,0" 
                                Height="300"
                                RowDetailsVisibilityMode="Visible"
                                >
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFKRS}" Header=""   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=采购单}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=ABAAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header=""   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=ABAVKAUFPOS,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=单}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=UPOS}" Header="{Binding Source={Localization:Translate Word=行}}"   Width="30" />
                                <DataGridTextColumn Binding="{Binding Path=MTYPE}" Header="{Binding Source={Localization:Translate Word=类}}"   Width="30" />
                                <DataGridTextColumn Binding="{Binding Path=ABAART, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=物料}}"   Width="80" />
                                <DataGridTextColumn Binding="{Binding Path=ABAFARBE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=色号}}"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=ABAGROE, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=尺码}}"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=ARTDES, Converter={StaticResource ResourceKey=Trim}}" Header="{Binding Source={Localization:Translate Word=描述}}"   Width="160" />
                                <DataGridTextColumn Binding="{Binding Path=WAUEBM}" Header="{Binding Source={Localization:Translate Word=UM}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=QTYSTD}" Header="{Binding Source={Localization:Translate Word=标量S}}"   Width="60" />
                                <DataGridTextColumn Binding="{Binding Path=QTYPLAN}" Header="{Binding Source={Localization:Translate Word=计量P}}"   Width="60" />
                                <DataGridTextColumn Binding="{Binding Path=QTYACT}" Header="{Binding Source={Localization:Translate Word=实量A}}"   Width="60" />
                                <DataGridTextColumn Binding="{Binding Path=PRSTD}" Header="{Binding Source={Localization:Translate Word=标价S}}"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=PREK}" Header="{Binding Source={Localization:Translate Word=采购E}}"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=PRPLAN}" Header="{Binding Source={Localization:Translate Word=计划P}}"   Width="40" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYSTDPRSTD}" Header="{Binding Source={Localization:Translate Word=VSS}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYSTDPREK}" Header="{Binding Source={Localization:Translate Word=VSE}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYSTDPRPLAN}" Header="{Binding Source={Localization:Translate Word=VSP}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYPLANPRSTD}" Header="{Binding Source={Localization:Translate Word=VPS}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYPLANPREK}" Header="{Binding Source={Localization:Translate Word=VPE}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYPLANPRPLAN}" Header="{Binding Source={Localization:Translate Word=VPP}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYACTPRSTD}" Header="{Binding Source={Localization:Translate Word=VAS}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYACTPREK}" Foreground="Red" Header="{Binding Source={Localization:Translate Word=VAE}}"   Width="Auto" />
                                <DataGridTextColumn Binding="{Binding Path=VQTYACTPRPLAN}" Header="{Binding Source={Localization:Translate Word=VAP}}"   Width="Auto" />
                            </DataGrid.Columns>
                        </DataGrid  >
                    </StackPanel>
                </DockPanel>
            </Grid>
        </TabItem>
    </TabControl>
</local:DocumentBase>
